package zizai.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class TestController {
	
	@RequestMapping("/hello")
	@ResponseBody
	public String test(){
		
		return "hello spring mvc";
	}
	@RequestMapping("/index")
	public String goIndex(){
		return "index";
	}
	
	@RequestMapping("/index2")
	public ModelAndView goIndex2(){
		ModelAndView mv=new ModelAndView("index2");
		mv.addObject("name", "张三");
		return mv;
	}
	

}
